home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / UNIXLIB37B / !UnixLib37 / src / stdio / c / frdwr < prev    next >
Text File  |  1996-11-09  |  961b  |  40 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/stdio/c/RCS/frdwr,v $
  4.  * $Date: 1996/04/19 21:32:42 $
  5.  * $Revision: 1.1 $
  6.  * $State: Rel $
  7.  * $Author: simon $
  8.  *
  9.  * $Log: frdwr,v $
  10.  * Revision 1.1  1996/04/19 21:32:42  simon
  11.  * Initial revision
  12.  *
  13.  ***************************************************************************/
  14.  
  15. static const char rcs_id[] = "$Id: frdwr,v 1.1 1996/04/19 21:32:42 simon Rel $";
  16.  
  17. #include <stdio.h>
  18.  
  19. __STDIOLIB__
  20.  
  21. size_t fread (register void *buf, size_t size, size_t nmemb, register FILE * f)
  22. {
  23.   register int n;
  24.  
  25.   n = (int) (size * nmemb);
  26.  
  27.   return (((n = __fread (f, (char *) buf, n)) < 0) ? 0 : (size_t) (n / size));
  28. }
  29.  
  30. size_t
  31. fwrite (register const void *buf, size_t size, size_t nmemb,
  32.     register FILE * f)
  33. {
  34.   register int n;
  35.  
  36.   n = (int) (size * nmemb);
  37.  
  38.   return (((n = __fwrite (f, (char *) buf, n)) < 0) ? 0 : (size_t) (n / size));
  39. }
  40.